package sketch.ounit.fuzz;

import sketch.ounit.Values;
import junit.framework.Test;
import junit.framework.TestCase;
import junit.framework.TestSuite;

public class ExistingObjectFuzzerTest extends TestCase {

	public static Test suite() {
		return new TestSuite(ExistingObjectFuzzerTest.class);
	}
	
	public void setUp() {
		//set up the time limit, mimicing the usage of setting up the time limit
		ExistingObjectFuzzer.setTimeLimit(2);
	}
	
	public void testUsingFuzzObject() {
		System.out.println();
		System.out.println("test fuzzing treemap object....");
		treemap.TreeMap map = new treemap.TreeMap();
		Values.randomFuzz(map, treemap.TreeMap.class);
		System.out.println("The map is: " + map);
	}
	
	public void testUsingFuzzObjectRepeatedly() {
		System.out.println();
		System.out.println("test fuzzing treemap object repeatedly....");
		for(int i = 0; i < 50; i++) {
			treemap.TreeMap map = new treemap.TreeMap();
			Values.randomFuzz(map, treemap.TreeMap.class);
			System.out.println("The map is: " + map);
		}
	}
	
	public void testUsingFuzzObjectMoreFuzz() {
		System.out.println();
		System.out.println("test testUsingFuzzObjectMoreFuzz....");
		for(int i = 0; i < 5; i++) {
			treemap.TreeMap map = new treemap.TreeMap();
			Values.randomFuzz(map, treemap.TreeMap.class);
			map.put(3000);
			Values.randomFuzz(map, treemap.TreeMap.class);
			map.put(200);
			Values.randomFuzz(map, treemap.TreeMap.class);
			System.out.println("The map is: " + map);
		}
	}
}